// AWTApplet.cpp: implementation of the AWTApplet class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
//#include "AWTTest.h"
#include "AWTApplet.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

IMPLEMENT_DYNAMIC(AWTApplet, AWTPanel)

void Trace(LPTSTR lpsz);

AWTApplet::AWTApplet(CWnd* parent)
{
//	Trace("AWTApplet::AWTApplet 1\n");
	m_parent = new AWTContainer();
//	Trace("AWTApplet::AWTApplet 2\n");
	m_parent->setPeer(parent);
//	Trace("AWTApplet::AWTApplet 3\n");
	m_focusManager = new AWTFocusManager(this);
//	Trace("AWTApplet::AWTApplet 4\n");
}

AWTApplet::~AWTApplet()
{
	removeAll();
	m_parent->setPeer(NULL);
	delete m_parent;
	delete m_focusManager;
	if (m_focusListener != NULL)
	{
		if (m_focusListener->isMultiCaster())
		{
#ifdef UNDER_CE
			AWTEventMulticaster* mc = (AWTEventMulticaster*)m_focusListener;
#else
			AWTEventMulticaster* mc = dynamic_cast<AWTEventMulticaster*>(m_focusListener);
#endif
			delete mc;
		}
	}
}

//jd 09/05/00
AWTApplet::AWTApplet()
{
	m_parent = new AWTContainer();
	m_focusManager = new AWTFocusManager(this);
}



